/**
 *  author: wangcheng
 * date: 2018/08/17
 * des: 待我审批
 */
import request from '@/utils/request'



/**
 * 年度调薪
 * @param {*} data
 */
export function insertNd(data) {
  return request({
    url: '/salaryapplys/insertNd',
    method: 'post',
    data
  })
}

/**
 * 年度编辑保存
 * @param {*} data
 */
export function updateNd(data) {
  return request({
    url: '/salaryapplys/insertNdAgain',
    method: 'post',
    data
  })
}




/**
 *  private int countConrrection;//转正(1)
    private int countTurnover;//调动(2、3)
    private int countLeave;//离职(5、7)
    private int countDelay;//试用延期(4)
 */
export function findStatusCount(status) {
  return request({
    url: '/salaryapplys/findStatusCount',
    method: 'get',
    params: {
      status: status
    }
  })
}


/**
 * 入职列表
 */
export function getDealDelayList(params) {
  return request({
    url: '/salaryapplys/findAllRz',
    method: 'get',
    params: params
  })
}

/**
 * 转正列表
 */
export function getConrrectionList(params) {
  return request({
    url: '/salaryapplys/findAllZz',
    method: 'get',
    params: params
  })
}

/**
 * 调动列表
 */
export function getTurnoverList(params) {
  return request({
    url: '/salaryapplys/findAllTg',
    method: 'get',
    params: params
  })
}

/**
 * 年度列表
 */
export function getLeaveList(params) {
  return request({
    url: '/salaryapplys/findAllNd',
    method: 'get',
    params: params
  })
}




/**
 * 延期详情
 */
export function findDelayDetail(params) {
  return request({
    url: '/salaryverifys/findEntryDetail',
    method: 'get',
    params: params
  })
}
/**
 * 转正详情
 */
export function findConrrectDetail(params) {
  return request({
    url: '/salaryverifys/findConrrectDetail',
    method: 'get',
    params: params
  })
}
/**
 * 调动详情
 */
export function findTurnoverDetail(params) {
  return request({
    url: '/salaryverifys/findTurnoverDetail',
    method: 'get',
    params: params
  })
}
/**
 * 离职详情
 */
export function findLeaveDetail(params) {
  return request({
    url: '/salaryverifys/findYearDetail',
    method: 'get',
    params: params
  })
}

/**
 * 延期通过
 */
export function dealDelayApprove(params) {
  return request({
    url: '/salaryverifys/dealEntry',
    method: 'post',
    data: params
  })
}

/**
 * 转正通过
 */
export function dealConrrectionApprove(params) {
  return request({
    url: '/salaryverifys/dealConrrection',
    method: 'get',
    params: params
  })
}


/**
 * 调动通过
 */
export function dealTurnoverApprove(params) {
  return request({
    url: '/salaryverifys/dealTurnover',
    method: 'get',
    params: params
  })
}

/**
 * 离职通过
 */
export function dealLeaveApprove(params) {
  return request({
    url: '/salaryapplys/updateBackNd',
    method: 'put',
    params: params
  })
}







/**
 * 详情
 */
export function getReqdetail(id) {
  return request({
    url: '/recruitreqs/find/' + id,
    method: 'get'

  })
}

/**
 * 新增需求
 */
export function addRequire(data) {
  return request({
    url: '/recruitreqs/insert',
    method: 'post',
    data
  })
}
/**
 * 高级搜索
 */
export function searchRequire(data) {
  // console.log(data);
  return request({
    url: '/hr/recruit/require/searchReq/mock',
    method: 'get',
    data
  })
}
/**
 * 编辑需求
 */
export function editRequire(data) {
  return request({
    url: '/recruitreqs/update',
    method: 'put',
    data
  })
}

/**
 * 停止招聘
 */
export function stopRequire(data) {
  return request({
    url: 'recruitreqs/stopRecruits',
    method: 'put',
    data
  })
}

/**
 * 删除需求
 */
export function deleteReq(reqId) {
  return request({
    url: '/recruitreqs/delete/' + reqId,
    method: 'delete'

  })
}


/**
 * 放弃申请
 */
export function giveupReq(data) {
  return request({
    url: '/recruitreqs/giveup',
    method: 'delete',
    params: data
  })
}


/**
 * 重新提交
 */
export function updateSubmit(data) {
  return request({
    url: '/recruitreqs/updateBack',
    method: 'put',
    data: data
  })
}



/**
 * 年度调薪重新提交
 */
export function updateBackNd(data) {
  return request({
    url: '/salaryapplys/updateBackNd',
    method: 'put',
    data: data
  })
}






// 退回后修改转正动薪  	/v1/salaryapplys/updateBackConrrectionSalary
// 退回后修改调岗动薪  	/v1/salaryapplys/updateBackTurnoverSalary
// 退回后修改年度动薪  	/v1/salaryapplys/updateBackNd
// 退回后修改入职动薪  	/v1/salaryapplys/updateBackEntrySalary
/**
 *  退回后修改转正动薪
 */
// updateBackConrrectionSalary, updateBackTurnoverSalary, updateBackEntrySalary
export function updateBackConrrectionSalary(data) {
  return request({
    url: '/salaryapplys/updateBackConrrectionSalary',
    method: 'put',
    data: data
  })
}

/**
 * 退回后修改调岗动薪
 */
export function updateBackTurnoverSalary(data) {
  return request({
    url: '/salaryapplys/updateBackTurnoverSalary',
    method: 'put',
    data: data
  })
}


/**
 * 退回后修改入职动薪
 */
export function updateBackEntrySalary(data) {
  return request({
    url: '/salaryapplys/updateBackEntrySalary',
    method: 'put',
    data: data
  })
}
// /**
//  * 退回后修改年度动薪
//  */
// export function updateBackNd(data) {
//   return request({
//     url: '/salaryapplys/updateBackNd',
//     method: 'put',
//     data: data
//   })
// }


// /hr/employeemanage/employees/find?employeeNo=121

/**
 * 根据 员工编号获取信息
 * @param {*} employeeNo
 */
export function findEmployeeDetail(employeeNo) {
  return request({
    url: '/hr/employeemanage/employees/find?employeeNo=' + employeeNo,
    method: 'get'
  })
}

/**
 * 根据 employeeNo 获取薪资信息
 * @param {*} employeeNo
 */
export function findsalary(employeeNo) {
  return request({
    url: '/employeesalarys/find/' + employeeNo,
    method: 'get'
  })
}



/**
 * 根据部门岗位职级获取薪资信息
 * @param {*} employeeNo
 */
export function findSalaryByLevel(data) {
  return request({
    url: '/hr/salary/salaryfixs/findSalary',
    method: 'get',
    params: data
  })
}

/**
 * 根据部门岗位获取职级别
 * @param {*} employeeNo
 */
export function findLevel(data) {
  return request({
    url: '/hr/salary/salaryfixs/findLevel',
    method: 'get',
    params: data
  })
}

/**
 * 删除年度调薪
 * @param {*} data
 */
export function deleteNd(data) {
  return request({
    url: '/salaryapplys/deleteNd',
    method: 'Post',
    params: data
  })
}
